import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xwl
 * Date: 2023-04-17
 * Time: 9:13
 */
public class Count {
    public static int countSegments(String s) {
        // 定义一个返回值
        int ret = 0;
        //
        String[] ch = s.split(" ");
        for(int i = 0; i < ch.length; i++) {
            if (!ch[i].equals("")) {
                ret++;
            }
        }
        return ret;
    }
    public static void main(String[] args) {
        // 输入
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        // 调用方法
        int ret = countSegments(str);
        // 输出
        System.out.println(ret);

    }
}
